const express = require('express');
const router = express.Router();
const authMiddleware = require('../middleware/authMiddleware.js');
const jobsController = require('../controllers/jobsController.js');
const companiesController =require('../controllers/companiesController.js');
const userController =require('../controllers/userController.js');

// 工作岗位路由
router.get('/jobs',jobsController.getAllJobs);
router.get('/onlyjobs',jobsController.getOnlyJob)
router.get('/jobs/:id',jobsController.getJobById)
router.get('/filtrate',jobsController.filterJobs)
router.put('/addjob',jobsController.createJob);
router.put('/upjob/:id',jobsController.updateJob)
router.delete('/delete/:id',jobsController.deleteJob);

//公司信息路由
router.get('/companies',companiesController.getCompanies);
router.get('/company/:id',companiesController.getCompanyById);
router.put('/addcompany',companiesController.createCompany);
router.put('/upcompany/:company_id',companiesController.updateCompany);
router.put('/upcompanylogo',companiesController.updateCompanyLogo);

//用户路由
router.put('/adduser',userController.cerateUser);
router.get('/getuser/:username',userController.getUser);


// 认证路由
// router.post('/auth/login', userController.login);
router.post('/login',userController.login);

module.exports = router;